/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.sgsmcan.Dao;

import com.sgsmcan.Entidad.Raza;
import com.sgsmcan.Hibernate.HibernateUtil;
import com.sgsmcan.Utils.Utilitario;
import java.util.List;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;

/**
 *
 * @author David
 */
public class RazaDaoImpl extends HibernateDao<Raza> implements RazaDao<Raza> {

    @Override
    public List getRazas() {
        Session session = null;
        List<Raza> aux;
        try {
            session = HibernateUtil.getSessionFactory().openSession();
            Query query = session.createQuery("from Raza");
            aux = query.list();
            return aux;
        } catch (HibernateException e) {
            throw new HibernateException(e);
        } finally {
            if (session != null) {
                session.close();
            }
        }
    }

}
